﻿namespace DCHealthCheck.MvcWeb.Classes.ViewModels {

    #region Usings
    using DCHealthCheck.Common;
    using DCHealthCheck.DomainModel;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Threading;
    using System.Web;
    using System.Web.Mvc;

    #endregion

    public class ProductsViewModel : BaseViewModel {

        #region Members
        public string ProductName { get; set; }

        public List<SelectListItem> ProductNameSelectListItems { get; set; }

        public List<InstalledProduct> Products { get; set; }
        #endregion

        #region Constructor
        public ProductsViewModel() {
            this.Products = new List<InstalledProduct>();
            this.ProductNameSelectListItems = new List<SelectListItem>();
        }
        #endregion

        #region Methods
        public override void Initialize(){
            Global.DefaultLog.DebugFormat("[ThreadId: {0}] {1}", Thread.CurrentThread.ManagedThreadId, Extensions.CurrentMethodName());

            base.Initialize();
            this.TakeCount = 15;

            if (string.IsNullOrWhiteSpace(this.SortColumn)) {
                this.SortColumn = "Name";
            }

            if (this.ProductName == null) this.ProductName = string.Empty;
        } 
        #endregion

    }
}